3.1179 \(\int \frac {(c+d \tan (e+f x))^n}{(a+i a \tan (e+f x))^3} \, dx\)

Optimal. Leaf size=381 \[ \frac {\left (3 i c^2-3 c d (3-n)-i d^2 \left (2 n^2-9 n+10\right )\right ) (c+d \tan (e+f x))^{n+1}}{24 f (c+i d)^3 \left (a^3+i a^3 \tan (e+f x)\right )}+\frac {\left (3 i c^3-c^2 d (9-6 n)-3 i c d^2 \left (2 n^2-6 n+3\right )+d^3 \left (-4 n^3+18 n^2-20 n+3\right )\right ) (c+d \tan (e+f x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac {c+d \tan (e+f x)}{c+i d}\right )}{48 a^3 f (n+1) (c+i d)^4}+\frac {(c+d \tan (e+f x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac {c+d \tan (e+f x)}{c-i d}\right )}{16 a^3 f (n+1) (d+i c)}+\frac {(-d (7-2 n)+3 i c) (c+d \tan (e+f x))^{n+1}}{24 a f (c+i d)^2 (a+i a \tan (e+f x))^2}-\frac {(c+d \tan (e+f x))^{n+1}}{6 f (-d+i c) (a+i a \tan (e+f x))^3} \]

[Out]

1/16*hypergeom([1, 1+n],[2+n],(c+d*tan(f*x+e))/(c-I*d))*(c+d*tan(f*x+e))^(1+n)/a^3/(I*c+d)/f/(1+n)+1/48*(3*I*c
^3-c^2*d*(9-6*n)-3*I*c*d^2*(2*n^2-6*n+3)+d^3*(-4*n^3+18*n^2-20*n+3))*hypergeom([1, 1+n],[2+n],(c+d*tan(f*x+e))
/(c+I*d))*(c+d*tan(f*x+e))^(1+n)/a^3/(c+I*d)^4/f/(1+n)-1/6*(c+d*tan(f*x+e))^(1+n)/(I*c-d)/f/(a+I*a*tan(f*x+e))
^3+1/24*(3*I*c-d*(7-2*n))*(c+d*tan(f*x+e))^(1+n)/a/(c+I*d)^2/f/(a+I*a*tan(f*x+e))^2+1/24*(3*I*c^2-3*c*d*(3-n)-
I*d^2*(2*n^2-9*n+10))*(c+d*tan(f*x+e))^(1+n)/(c+I*d)^3/f/(a^3+I*a^3*tan(f*x+e))

________________________________________________________________________________________

Rubi [A]  time = 1.06, antiderivative size = 381, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3559, 3596, 3539, 3537, 68} \[ \frac {\left (-c^2 d (9-6 n)+3 i c^3-3 i c d^2 \left (2 n^2-6 n+3\right )+d^3 \left (-4 n^3+18 n^2-20 n+3\right )\right ) (c+d \tan (e+f x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac {c+d \tan (e+f x)}{c+i d}\right )}{48 a^3 f (n+1) (c+i d)^4}+\frac {\left (3 i c^2-3 c d (3-n)-i d^2 \left (2 n^2-9 n+10\right )\right ) (c+d \tan (e+f x))^{n+1}}{24 f (c+i d)^3 \left (a^3+i a^3 \tan (e+f x)\right )}+\frac {(c+d \tan (e+f x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac {c+d \tan (e+f x)}{c-i d}\right )}{16 a^3 f (n+1) (d+i c)}+\frac {(-d (7-2 n)+3 i c) (c+d \tan (e+f x))^{n+1}}{24 a f (c+i d)^2 (a+i a \tan (e+f x))^2}-\frac {(c+d \tan (e+f x))^{n+1}}{6 f (-d+i c) (a+i a \tan (e+f x))^3} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*Tan[e + f*x])^n/(a + I*a*Tan[e + f*x])^3,x]

[Out]

(Hypergeometric2F1[1, 1 + n, 2 + n, (c + d*Tan[e + f*x])/(c - I*d)]*(c + d*Tan[e + f*x])^(1 + n))/(16*a^3*(I*c
 + d)*f*(1 + n)) + (((3*I)*c^3 - c^2*d*(9 - 6*n) - (3*I)*c*d^2*(3 - 6*n + 2*n^2) + d^3*(3 - 20*n + 18*n^2 - 4*
n^3))*Hypergeometric2F1[1, 1 + n, 2 + n, (c + d*Tan[e + f*x])/(c + I*d)]*(c + d*Tan[e + f*x])^(1 + n))/(48*a^3
*(c + I*d)^4*f*(1 + n)) - (c + d*Tan[e + f*x])^(1 + n)/(6*(I*c - d)*f*(a + I*a*Tan[e + f*x])^3) + (((3*I)*c -
d*(7 - 2*n))*(c + d*Tan[e + f*x])^(1 + n))/(24*a*(c + I*d)^2*f*(a + I*a*Tan[e + f*x])^2) + (((3*I)*c^2 - 3*c*d
*(3 - n) - I*d^2*(10 - 9*n + 2*n^2))*(c + d*Tan[e + f*x])^(1 + n))/(24*(c + I*d)^3*f*(a^3 + I*a^3*Tan[e + f*x]
))

Rule 68

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((b*c - a*d)^n*(a + b*x)^(m + 1)*Hype
rgeometric2F1[-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b^(n + 1)*(m + 1)), x] /; FreeQ[{a, b, c, d, m
}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] && IntegerQ[n]

Rule 3537

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(c*
d)/f, Subst[Int[(a + (b*x)/d)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] &&
NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]

Rule 3539

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(c
 + I*d)/2, Int[(a + b*Tan[e + f*x])^m*(1 - I*Tan[e + f*x]), x], x] + Dist[(c - I*d)/2, Int[(a + b*Tan[e + f*x]
)^m*(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0]
&& NeQ[c^2 + d^2, 0] &&  !IntegerQ[m]

Rule 3559

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[(a*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(2*f*m*(b*c - a*d)), x] + Dist[1/(2*a*m*(b*c - a*d))
, Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[b*c*m - a*d*(2*m + n + 1) + b*d*(m + n + 1)*Tan
[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2
+ d^2, 0] && LtQ[m, 0] && (IntegerQ[m] || IntegersQ[2*m, 2*n])

Rule 3596

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((a*A + b*B)*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(2
*f*m*(b*c - a*d)), x] + Dist[1/(2*a*m*(b*c - a*d)), Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Si
mp[A*(b*c*m - a*d*(2*m + n + 1)) + B*(a*c*m - b*d*(n + 1)) + d*(A*b - a*B)*(m + n + 1)*Tan[e + f*x], x], x], x
] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0] &&  !GtQ[n,
0]

Rubi steps

\begin {align*} \int \frac {(c+d \tan (e+f x))^n}{(a+i a \tan (e+f x))^3} \, dx &=-\frac {(c+d \tan (e+f x))^{1+n}}{6 (i c-d) f (a+i a \tan (e+f x))^3}-\frac {\int \frac {(c+d \tan (e+f x))^n (-a (3 i c-d (5-n))-i a d (2-n) \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx}{6 a^2 (i c-d)}\\ &=-\frac {(c+d \tan (e+f x))^{1+n}}{6 (i c-d) f (a+i a \tan (e+f x))^3}+\frac {(3 i c-d (7-2 n)) (c+d \tan (e+f x))^{1+n}}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2}-\frac {\int \frac {(c+d \tan (e+f x))^n \left (-a^2 \left (6 c^2+3 i c d (5-n)-d^2 \left (13-9 n+2 n^2\right )\right )-a^2 d (3 c+i d (7-2 n)) (1-n) \tan (e+f x)\right )}{a+i a \tan (e+f x)} \, dx}{24 a^4 (c+i d)^2}\\ &=-\frac {(c+d \tan (e+f x))^{1+n}}{6 (i c-d) f (a+i a \tan (e+f x))^3}+\frac {(3 i c-d (7-2 n)) (c+d \tan (e+f x))^{1+n}}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2}+\frac {\left (3 i c^2-3 c d (3-n)-i d^2 \left (10-9 n+2 n^2\right )\right ) (c+d \tan (e+f x))^{1+n}}{24 (c+i d)^3 f \left (a^3+i a^3 \tan (e+f x)\right )}-\frac {\int (c+d \tan (e+f x))^n \left (2 a^3 \left (3 i c^3-3 c^2 d (3-n)-3 i c d^2 \left (3-3 n+n^2\right )+d^3 \left (3-10 n+9 n^2-2 n^3\right )\right )-2 a^3 d n \left (3 i c^2-3 c d (3-n)-i d^2 \left (10-9 n+2 n^2\right )\right ) \tan (e+f x)\right ) \, dx}{48 a^6 (i c-d)^3}\\ &=-\frac {(c+d \tan (e+f x))^{1+n}}{6 (i c-d) f (a+i a \tan (e+f x))^3}+\frac {(3 i c-d (7-2 n)) (c+d \tan (e+f x))^{1+n}}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2}+\frac {\left (3 i c^2-3 c d (3-n)-i d^2 \left (10-9 n+2 n^2\right )\right ) (c+d \tan (e+f x))^{1+n}}{24 (c+i d)^3 f \left (a^3+i a^3 \tan (e+f x)\right )}+\frac {\int (1+i \tan (e+f x)) (c+d \tan (e+f x))^n \, dx}{16 a^3}-\frac {\left (3 i c^3-3 c^2 d (3-2 n)-3 i c d^2 \left (3-6 n+2 n^2\right )+d^3 \left (3-20 n+18 n^2-4 n^3\right )\right ) \int (1-i \tan (e+f x)) (c+d \tan (e+f x))^n \, dx}{48 a^3 (i c-d)^3}\\ &=-\frac {(c+d \tan (e+f x))^{1+n}}{6 (i c-d) f (a+i a \tan (e+f x))^3}+\frac {(3 i c-d (7-2 n)) (c+d \tan (e+f x))^{1+n}}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2}+\frac {\left (3 i c^2-3 c d (3-n)-i d^2 \left (10-9 n+2 n^2\right )\right ) (c+d \tan (e+f x))^{1+n}}{24 (c+i d)^3 f \left (a^3+i a^3 \tan (e+f x)\right )}+\frac {i \operatorname {Subst}\left (\int \frac {(c-i d x)^n}{-1+x} \, dx,x,i \tan (e+f x)\right )}{16 a^3 f}+\frac {\left (i \left (3 i c^3-3 c^2 d (3-2 n)-3 i c d^2 \left (3-6 n+2 n^2\right )+d^3 \left (3-20 n+18 n^2-4 n^3\right )\right )\right ) \operatorname {Subst}\left (\int \frac {(c+i d x)^n}{-1+x} \, dx,x,-i \tan (e+f x)\right )}{48 a^3 (i c-d)^3 f}\\ &=\frac {\, _2F_1\left (1,1+n;2+n;\frac {c+d \tan (e+f x)}{c-i d}\right ) (c+d \tan (e+f x))^{1+n}}{16 a^3 (i c+d) f (1+n)}+\frac {\left (3 i c^3-c^2 d (9-6 n)-3 i c d^2 \left (3-6 n+2 n^2\right )+d^3 \left (3-20 n+18 n^2-4 n^3\right )\right ) \, _2F_1\left (1,1+n;2+n;\frac {c+d \tan (e+f x)}{c+i d}\right ) (c+d \tan (e+f x))^{1+n}}{48 a^3 (c+i d)^4 f (1+n)}-\frac {(c+d \tan (e+f x))^{1+n}}{6 (i c-d) f (a+i a \tan (e+f x))^3}+\frac {(3 i c-d (7-2 n)) (c+d \tan (e+f x))^{1+n}}{24 a (c+i d)^2 f (a+i a \tan (e+f x))^2}+\frac {\left (3 i c^2-3 c d (3-n)-i d^2 \left (10-9 n+2 n^2\right )\right ) (c+d \tan (e+f x))^{1+n}}{24 (c+i d)^3 f \left (a^3+i a^3 \tan (e+f x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]  time = 35.47, size = 0, normalized size = 0.00 \[ \int \frac {(c+d \tan (e+f x))^n}{(a+i a \tan (e+f x))^3} \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[(c + d*Tan[e + f*x])^n/(a + I*a*Tan[e + f*x])^3,x]

[Out]

Integrate[(c + d*Tan[e + f*x])^n/(a + I*a*Tan[e + f*x])^3, x]

________________________________________________________________________________________

fricas [F]  time = 0.48, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {\left (\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n} {\left (e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{8 \, a^{3}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

integral(1/8*(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1))^n*(e^(6*I*f*x + 6*I*e) + 3*
e^(4*I*f*x + 4*I*e) + 3*e^(2*I*f*x + 2*I*e) + 1)*e^(-6*I*f*x - 6*I*e)/a^3, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (d \tan \left (f x + e\right ) + c\right )}^{n}}{{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{3}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^3,x, algorithm="giac")

[Out]

integrate((d*tan(f*x + e) + c)^n/(I*a*tan(f*x + e) + a)^3, x)

________________________________________________________________________________________

maple [F]  time = 1.27, size = 0, normalized size = 0.00 \[ \int \frac {\left (c +d \tan \left (f x +e \right )\right )^{n}}{\left (a +i a \tan \left (f x +e \right )\right )^{3}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^3,x)

[Out]

int((c+d*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^3,x)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^n/(a+I*a*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {{\left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n}{{\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*tan(e + f*x))^n/(a + a*tan(e + f*x)*1i)^3,x)

[Out]

int((c + d*tan(e + f*x))^n/(a + a*tan(e + f*x)*1i)^3, x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {i \int \frac {\left (c + d \tan {\left (e + f x \right )}\right )^{n}}{\tan ^{3}{\left (e + f x \right )} - 3 i \tan ^{2}{\left (e + f x \right )} - 3 \tan {\left (e + f x \right )} + i}\, dx}{a^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))**n/(a+I*a*tan(f*x+e))**3,x)

[Out]

I*Integral((c + d*tan(e + f*x))**n/(tan(e + f*x)**3 - 3*I*tan(e + f*x)**2 - 3*tan(e + f*x) + I), x)/a**3

________________________________________________________________________________________